﻿
using MicroMvvm;
using ModernUILogViewer.Business;
using System.Net;
using System.Reactive.Linq;
using System.Windows.Input;
namespace ModernUILogViewer.ViewModel
{
    public class MainViewModel : BaseViewModel
    {
        #region Constructor

        public MainViewModel()
        {            
            //if (FirstFloor.ModernUI.ModernUIHelper.IsInDesignMode == false)
            AppVersion = Utility.GetProductVersion().ToString();

            HomeVM = new HomeViewModel(this);
            TailLogVM = new TailLogViewModel(this);
            OptionsVM = new OptionsViewModel(this);
            NetworkVM = new NetworkViewModel();
            FileWatcherOptionsVM = new FileWatcherOptionsViewModel();
            TestFileResultVM = new TestFileResultViewModel(this);
            StatisticsVM = new StatisticsViewModel(this);
            ExternalEditorVM = new ExternalEditorViewModel();            
        }
        
        #endregion

        #region Properties

        public ExternalEditorViewModel ExternalEditorVM { get; private set; }
        public TestFileResultViewModel TestFileResultVM { get; private set; }
        public HomeViewModel HomeVM { get; private set; }
        public TailLogViewModel TailLogVM { get; private set; }
        public OptionsViewModel OptionsVM { get; private set; }
        public NetworkViewModel NetworkVM { get; private set; }
        public FileWatcherOptionsViewModel FileWatcherOptionsVM { get; private set; }
        public StatisticsViewModel StatisticsVM { get; private set; }

        private string appVersion;

        public string AppVersion
        {
            get { return appVersion; }
            set
            {
                appVersion = value;
                RaisePropertyChanged(() => AppVersion);
            }
        }
        
        #endregion

    }
}
